package route

import (
	"time"

	"gitee.com/jiebaiyou/formflow/api/controller"
	"gitee.com/jiebaiyou/formflow/bootstrap"
	"gitee.com/jiebaiyou/formflow/pkg/storage/redis"
	"gitee.com/jiebaiyou/formflow/pkg/storage/sqlite"
	"gitee.com/jiebaiyou/formflow/service"
	"github.com/gin-gonic/gin"
)

// NewSystemRouter 设置系统相关路由
func NewSystemRouter(env *bootstrap.Config, timeout time.Duration, db sqlite.DB, cache redis.Database, group *gin.RouterGroup) {
	// 初始化系统服务
	ss := service.NewSystemService(timeout)
	// 初始化系统控制器
	sc := &controller.SystemController{
		SystemService: ss,
	}

	// 系统相关API
	group.GET("/health", sc.GetHealth)
	group.GET("/info", sc.GetSystemInfo)
}
